Skip to content

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Oct 7, 2025

Adds e2e tests to the core assistant features.

@gagik gagik changed the title chore(compass-e2e-tests): add assistant end to end tests COMPASS-9384 chore(compass-e2e-tests): add assistant end to end tests COMPASS-9748 Oct 8, 2025
@gagik gagik marked this pull request as ready for review October 8, 2025 10:41
@gagik gagik requested a review from a team as a code owner October 8, 2025 10:41
@gagik gagik requested review from johnjackweir and Copilot October 8, 2025 10:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive end-to-end tests for the MongoDB Assistant feature in Compass. The tests cover various scenarios including AI feature opt-in flow, message sending, drawer interactions, and entry points from explain plans and error messages.

  • Adds complete e2e test suite for Assistant functionality with 593 lines of test code
  • Implements mock assistant service to simulate AI responses with streaming support
  • Adds necessary test selectors and data-testid attributes for UI elements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/compass-generative-ai/src/components/ai-optin-modal.tsx Adds data-testid for testing the AI opt-in modal
packages/compass-e2e-tests/tests/assistant.test.ts Complete test suite covering assistant drawer, opt-in flow, messaging, and entry points
packages/compass-e2e-tests/helpers/selectors.ts Adds selectors for assistant UI elements and AI settings
packages/compass-e2e-tests/helpers/assistant-service.ts Mock service implementation for simulating assistant API responses

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Assigned mabaasit for team compass-developers because johnjackweir is out of office.

@gagik gagik requested a review from lerouxb October 8, 2025 10:47
newValue === false
) {
// Reseting the opt-in to false can be tricky so it's best to start over in this case.
compass = await init(this.test?.fullTitle(), { firstRun: false });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to try cleanup(compass); before making a new one?

const collectionName = 'entryPoints';

before(async function () {
skipForWeb(this, 'ai assistant not yet available in compass-web');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't this true, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow I fully missed this AI-coded bit after so many looks 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants